<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>空间转换-立体呈现</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    .box {
      position: relative;
      margin: 160px;
      width: 600px;
      height: 200px;
      background-color: rgba(0, 0, 0, .3);
      /* 立体呈现 */
      transform-style: preserve-3d;
      /* 旋转Y轴 */
      /* transform: rotateY(88deg); */
      transition: all 2s;
    }

    .before,
    .after {
      position: absolute;
      top: 0;
      width: 100%;
      height: 100%;
    }

    .box img {
      width: 100%;
      height: 100%;
    }

    /* 前图 */
    .box .before {
      transform: translateZ(200px);
    }


    /* 后图 */
    .box .after {
      transform: translateZ(-200px);
    }

    .box:hover {
      transform: rotateY(30deg);
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="before">
      <img src="../../素材/images/AI01.png" alt="">
    </div>
    <div class="after">
      <img src="../../素材/images/dog1.webp" alt="">
    </div>
  </div>
</body>

</html>